/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bgu.sonar.util;

import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author bennyl
 */
public class Exts {

    @SuppressWarnings("unchecked")
    public static <K, V> Map<K, V> assoc(K key, V value, Object... kvs) {
        Map<K, V> map = new HashMap<>();
        map.put(key, value);

        for (int i = 0; i < kvs.length; i += 2) {
            map.put((K) kvs[i], (V) kvs[i + 1]);
        }
        return map;
    }
}
